import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';

export const columns: BasicColumn[] = [
  {
    title: '家庭id',
    dataIndex: 'id',
    defaultHidden: true,
    align: 'center',
    width: 200,
  },
  {
    title: '组号',
    dataIndex: 'groupNumber',

    align: 'center',
    width: 200,
  },
  {
    title: '户口类型',
    dataIndex: 'hkType',
    align: 'center',
    width: 200,
  },
  {
    title: '户口本号',
    dataIndex: 'hkbNumber',
    align: 'center',
    ifShow: false,
    width: 200,
  },
  {
    title: '户主',
    dataIndex: 'householder',
    align: 'center',
    ifShow: true,
    width: 200,
  },
  {
    title: '联系电话',
    dataIndex: 'contactNumber',

    align: 'center',
    width: 200,
  },
  {
    title: '家庭地址',
    dataIndex: 'address',

    align: 'center',
    width: 200,
  },
  {
    title: '月收入（元）',
    dataIndex: 'monthIncome',

    align: 'center',
    width: 200,
  },
  {
    title: '经济状况',
    dataIndex: 'economyStatus',

    align: 'center',
    width: 200,
  },
  {
    title: '住所类型',
    dataIndex: 'abodeType',

    align: 'center',
    width: 200,
  },
  {
    title: '用户登录账号',
    dataIndex: 'userId',
    align: 'center',
    width: 200,
  },
  /*{
    title: '户主id（居民）',
    dataIndex: 'householderId',

    align: 'center',
    width: 200,
  },*/
  {
    title: '创建时间',
    dataIndex: 'dateCreated',

    align: 'center',
    width: 200,
  },
  {
    title: '修改时间',
    dataIndex: 'dateModified',
    ifShow: false,
    align: 'center',
    width: 200,
  },
  {
    title: '创建人id',
    dataIndex: 'createdBy',
    ifShow: false,
    align: 'center',
    width: 200,
  },
  {
    title: '创建人',
    dataIndex: 'createdByName',
    ifShow: false,
    align: 'center',
    width: 200,
  },
  {
    title: '修改人Id',
    dataIndex: 'modifiedBy',
    ifShow: false,
    align: 'center',
    width: 200,
  },
  {
    title: '修改人',
    dataIndex: 'modifiedByName',
    ifShow: false,
    align: 'center',
    width: 200,
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'hkType',
    label: '户口类型',
    component: 'Select',
    componentProps: {
      placeholder: '请输入户口类型',
      options: [
        { label: '农村', value: '农村' },
        { label: '城镇', value: '城镇' },
      ],
    },
    colProps: { span: 6 },
  },
  {
    field: 'householder',
    label: '户主',
    component: 'Input',
    componentProps: {
      placeholder: '请输入户主',
    },
    colProps: { span: 6 },
  },
  {
    field: 'address',
    label: '家庭地址',
    component: 'Input',
    componentProps: {
      placeholder: '请输入家庭地址',
    },
    colProps: { span: 6 },
  },
];

export const formSchema: FormSchema[] = [
  {
    field: 'id',
    label: '家庭id',
    component: 'Input',
    show: false,
    required: false,

    componentProps: {
      disabled: false,
      placeholder: '请输入家庭id',
    },
    colProps: { span: 12 },
  },
  {
    field: 'hkType',
    label: '户口类型',
    component: 'Select',
    show: true,
    required: true,

    componentProps: {
      disabled: false,
      placeholder: '请输入户口类型',
      options: [
        { label: '农村', value: '农村' },
        { label: '城镇', value: '城镇' },
      ],
    },
    colProps: { span: 12 },
  },
  {
    field: 'groupNumber',
    label: '组号',
    component: 'Input',
    show: true,
    required: true,

    componentProps: {
      disabled: false,
      placeholder: '请输入组号',
    },
    colProps: { span: 12 },
  },
  {
    field: 'hkbNumber',
    label: '户口本号',
    component: 'Input',
    show: true,
    required: true,

    componentProps: {
      disabled: false,
      placeholder: '请输入户口本号',
    },
    colProps: { span: 12 },
  },
  {
    field: 'householder',
    label: '户主',
    component: 'Input',
    show: true,
    required: true,
    colProps: { span: 12 },
  },
  {
    field: 'householderId',
    label: '户主Id',
    component: 'Input',
    show: false,
    required: false,
    colProps: { span: 12 },
  },
  {
    field: 'contactNumber',
    label: '联系电话',
    component: 'Input',
    show: true,
    required: true,

    componentProps: {
      disabled: false,
      placeholder: '请输入联系电话',
    },
    colProps: { span: 12 },
  },
  {
    field: 'address',
    label: '家庭地址',
    component: 'Input',
    show: true,
    required: true,

    componentProps: {
      disabled: false,
      placeholder: '请输入家庭地址',
    },
    colProps: { span: 12 },
  },
  {
    field: 'monthIncome',
    label: '月收入（元）',
    component: 'Input',
    show: true,
    required: false,

    componentProps: {
      disabled: false,
      placeholder: '请输入月收入（元）',
    },
    colProps: { span: 12 },
  },
  {
    field: 'economyStatus',
    label: '经济状况',
    component: 'Input',
    show: true,
    required: false,

    componentProps: {
      disabled: false,
      placeholder: '请输入经济状况',
    },
    colProps: { span: 12 },
  },
  {
    field: 'abodeType',
    label: '住所类型',
    component: 'Select',
    show: true,
    required: false,

    componentProps: {
      disabled: false,
      placeholder: '请输入住所类型（楼房，矮房，别墅，危房，暂无）',
      options: [
        {
          label: '无住房',
          value: '无住房',
        },
        { label: '个人出租房屋', value: '个人出租房屋' },
        { label: '个人自购（自建）房屋', value: '个人自购（自建）房屋' },
        { label: '直系亲属自购（自建）房屋', value: '直系亲属自购（自建）房屋' },
        { label: '亲友自购（自建）房屋', value: '亲友自购（自建）房屋' },
        {
          label: '单位、学校宿舍或单位、学校自购（自建）房屋',
          value: '单位、学校宿舍或单位、学校自购（自建）房屋',
        },
      ],
    },
    colProps: { span: 12 },
  },
  {
    field: 'userId',
    label: '用户登录账号',
    component: 'Input',
    show: false,
    required: false,
    componentProps: {
      disabled: false,
      placeholder: '请输入（每个家庭只有一个账号）',
    },
    colProps: { span: 12 },
  },
  // {
  //   field: 'householderId',
  //   label: '户主',
  //   component: 'ApiSelect',
  //   show: true,
  //   required: false,
  //   componentProps: {
  //     api: getFixResidentList,
  //     labelField: 'name',
  //     valueField: 'id',
  //     placeholder: '请选择',
  //   },
  //   colProps: { span: 12 },
  // },
];
